package com.daxt.model.service.base.vo;


import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

import org.springframework.format.annotation.DateTimeFormat;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.daxt.model.entity.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value = "用户", description = "用户")
@TableName("base_user")
public class BaseUser extends BaseEntity implements Serializable{
	
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	@ApiModelProperty(value = "租户id", name = "tenantId")
	private String tenantId;
	@ApiModelProperty(value = "账号", name = "username")
	private String username;
	
	@ApiModelProperty(value = "密码", name = "password")
	private String password;
	
	@ApiModelProperty(value = "姓名", name = "realName")
	private String realName;
	
	@ApiModelProperty(value = "邮箱", name = "email")
	private String email;

	@ApiModelProperty(value = "手机号", name = "mobile")
	private String mobile;
	
	@ApiModelProperty(value = "状态  0锁定  1整除", name = "state")
	private String  state;

	@ApiModelProperty(value = "部门id集", name = "deptIds")
	private Long  deptIds;
//	@ApiModelProperty(value = "标识 1前台 2后台", name = "flag")
//	private String  flag;

	@ApiModelProperty(value = "外部ID", name = "extId")
	private String  extId;

	@ApiModelProperty(value = "登录次数", name = "loginNumber")
	private Integer loginNumber;


	
	@JsonDeserialize(using = LocalDateTimeDeserializer.class)
	@JsonSerialize(using = LocalDateTimeSerializer.class)
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@ApiModelProperty(value = "最后登录时间时间", name = "lastLoginTime",example = "2019-09-09 00:00:00")
	private LocalDateTime lastLoginTime;
	

	@TableField(exist = false)
	private List<UserRole> userRole;
	@TableField(exist = false)
	private List<UserFonds> userFonds;
	@TableField(exist = false)
	private List<UserPost> userPosts;
	@TableField(exist = false)
	private List<Dept> depts;

}